//
//  DQBOptionCollectionViewCell.m
//  DrivingQuestionBank
//
//  Created by mac on 2023/12/28.
//

#import "DQBOptionCollectionViewCell.h"

@implementation DQBOptionCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self optionCellSubView];
    }
    return self;
}

//- (void)setModel:(DQBQuestionModel *)model {
//    _model = model;
//    _optionLabel.text = _model.options[0]
//}

- (void)optionCellSubView{
    [self.contentView addSubview:[self optionLabel]];
    [_optionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.centerY.mas_equalTo(0);
        make.top.mas_equalTo(10);
        make.width.height.mas_equalTo(24);
    }];
    [self.contentView addSubview:[self optionContentLabel]];
    [_optionContentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(50);
        make.centerY.mas_equalTo(0);
        make.height.mas_equalTo(22);
    }];
}

#pragma mark -- lazy
- (UILabel *)optionLabel{
    if (!_optionLabel) {
        _optionLabel = [[UILabel alloc] init];
        _optionLabel.backgroundColor = [UIColor lightGrayColor];
        _optionLabel.text = @"A";
        _optionLabel.textAlignment = NSTextAlignmentCenter;
        _optionLabel.font = [UIFont boldSystemFontOfSize:15];
        _optionLabel.layer.cornerRadius = 12;
        _optionLabel.layer.masksToBounds = YES;
    }
    return _optionLabel;
}

- (UILabel *)optionContentLabel{
    if (!_optionContentLabel) {
        _optionContentLabel = [[UILabel alloc] init];
        _optionContentLabel.text = @"选项A选项A选项A选项A";
    }
    return _optionContentLabel;
}

@end
